package com.astrob.model;

import android.content.Context;

import com.astrob.naviframe.Start;

import java.io.Serializable;
import java.text.SimpleDateFormat;
import java.util.Date;

public class HistroyCityData implements Serializable {
	private static final long serialVersionUID = 1L;
	public double lon;
	public double lat;
	public String name = "";

	public void revert(){
		name = "";
		lon = 180.0;
		lat = 90.0;
	}

	public HistroyCityData() {
		revert();
	}

	public LonLat getLl() {
		return new LonLat(lon, lat);
	}

	public void setLl(LonLat pos) {
		lon = pos.GetLon();
		lat = pos.GetLat();
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;

		HistroyCityData other = (HistroyCityData) obj;

		if (Double.doubleToLongBits(lat) != Double.doubleToLongBits(other.lat))
			return false;
		if (Double.doubleToLongBits(lon) != Double.doubleToLongBits(other.lon))
			return false;
		
		
		if (name == null) {
			if (other.name != null)
				return false;
		} else if (!name.equals(other.name))
			return false;
	
		return true;
	}

}
